﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Default/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<Fashion.ViewModels.OrderDetailModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Orders</h2>

    <table>
        <tr>
            <th></th>
            <th>
                OrderID
            </th>
            <th>
                Product Name
            </th>
            <th>
                Size
            </th>
            <th>
                Color
            </th>
            <th>
                Quantity
            </th>
            <th>
                Total Price
            </th>
            <th> 
                Order Date
            </th>
            <th>
                Ship Date
            </th>
            <th>
                Status
            </th>
        </tr>

    <% foreach (var item in Model.orderList) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "EditOrder", new { orderID=item.OrderID })%>
            </td>
            <td>
                <%: item.OrderID %>
            </td>
            <td>
                <%: item.productName %>
            </td>
            <td>
                <%: item.size %>
            </td>
            <td>
                <%: item.color %>
            </td>
            <td>
                <%: item.quantity %>
            </td>
            <td>
                <%: String.Format("{0:F}", item.TotalPrice) %>
            </td>
            <td>
                <%: String.Format("{0:dd/MM/yyyy}", item.OrderDate)%>
            </td>
            <td>
                <%: String.Format("{0:dd/MM/yyyy}", item.ShipDate)%>
            </td>
            <td>
                <%: item.CurrentStatus %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("View All Orders", "Orders/ViewAll") %> | <%: Html.ActionLink("Back to Dashboard", "Index") %>
    </p>
</asp:Content>

